﻿/**
 * Created by Administrator on 2017/3/2 0002.
 */
var Page9={
    create:function () {
    var page={};
        page.ui=new PIXI.DisplayObjectContainer();
        var bg=Easy.CreateSprite('assets/images/page_bg.png',0,0,0,0,1);
        page.ui.addChild(bg);

        var i0=Easy.CreateSprite('assets/images/p9_i0.png',740,101,0,0,1);
        page.ui.addChild(i0);
        var i1=Easy.CreateSprite('assets/images/p9_i1.png',0,636,0.0,0.5,0);
        page.ui.addChild(i1);

        var line=Easy.CreateSprite('assets/images/page_leftLine.png',0,102,0,0,0);
        line.height=1136;
        line.blendMode=PIXI.BLEND_MODES.MULTIPLY;
        page.ui.addChild(line);
        var line1=Easy.CreateSprite('assets/images/page_leftLine1.png',11,693,0.5,0.5,0);
        page.ui.addChild(line1);

        // i1.scale.x=i1.scale.y=0.9;
        // TweenMax.to(i1.scale,1,{repeat:-1,yoyo:true,repeatDelay:0,x:1.1,y:1.1,ease:Cubic.easeInOut})

        var t0=Easy.CreateSprite('assets/images/p9_t0.png',199,752,0.5,0.5,0);
        page.ui.addChild(t0);
        var t1=Easy.CreateSprite('assets/images/p9_t1.png',228,856,0.5,0.5,0);
        page.ui.addChild(t1);
        var t2=Easy.CreateSprite('assets/images/p9_t2.png',382,987,0.5,0.5,0);
        page.ui.addChild(t2);

        var tip=Easy.CreateSprite('assets/images/tip.png',370,1105,0.5,0.5,1);
        TweenMax.to(tip,1,{repeat:-1,yoyo:true,y:1105+30,alpha:0.7,ease:Cubic.easeInOut});
        page.ui.addChild(tip);

        var bt_locate=Easy.CreateSprite('assets/images/bt_locate.png',pixiStage.x+740,1020,1,0.5,1);
        bt_locate.interactive=true;
        page.ui.addChild(bt_locate);
        bt_locate.on('pointerdown',function()
        {
            showMap();
        });

        page.In=function () {
            i0.x=740;
            i0.alpha=0;
            TweenMax.to(i0,1.5,{delay:0.2*0,x:0,alpha:1,ease:Cubic.easeInOut,onComplete:function () {
                TweenMax.to(i0,15,{yoyo:true,repeat:-1,x:-316,repeatDelay:1,ease:Linear.easeNone});
            }});

            i1.x=-600;
            i1.alpha=0;
            TweenMax.to(i1,1.5,{delay:0.2*1,x:25-pixiStage.x,alpha:1,ease:Cubic.easeInOut});

            t0.y=752+100;
            t0.alpha=0;
            TweenMax.to(t0,1,{delay:0.3*3,y:752,alpha:1,ease:Cubic.easeInOut});
            t1.y=856+100;
            t1.alpha=0;
            TweenMax.to(t1,1,{delay:0.3*4,y:856,alpha:1,ease:Cubic.easeInOut});
            t2.y=987+100;
            t2.alpha=0;
            TweenMax.to(t2,1,{delay:0.3*5,y:987,alpha:1,ease:Cubic.easeInOut});

            line.x=-pixiStage.x;
            line.y=1136;
            line.alpha=0;
            TweenMax.to(line,1,{delay:0.3*3,y:102,alpha:1,ease:Cubic.easeInOut});
            line1.x=--pixiStage.x+11-30;
            line1.alpha=0;
            TweenMax.to(line1,1,{delay:0.3*3+0.1,x:-pixiStage.x+11,alpha:1,ease:Cubic.easeInOut});

        }
        page.Out=function()
        {
            TweenMax.killTweensOf(i0);
            TweenMax.killTweensOf(i1);
            TweenMax.killTweensOf(t0);
            TweenMax.killTweensOf(t1);
            TweenMax.killTweensOf(t2);
            TweenMax.killTweensOf(line);
            TweenMax.killTweensOf(line1);

            TweenMax.to(page.ui,0.3,{alpha:1,onComplete:function () {
                page.ui.alpha=1;
                i0.alpha=0;
                i1.alpha=0;
                t0.alpha=0;
                t1.alpha=0;
                t2.alpha=0;
                line.x=-30;
                line1.x=-30;
            }})
        }

    return page;
    }
}